import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/home',
      name: 'home',
      component: () =>
        import(/* webpackChunkName: "home" */ '@/views/home/home'),
      meta: {
        index: 1,
      },
    },
    {
      path: '/articleDetail',
      name: 'articleDetail',
      component: () =>
        import(
          /* webpackChunkName: "home" */ '@/views/home/scienceArticle/articleDetail'
        ),
      meta: {
        index: 2,
      },
    },
    {
      path: '/medicineShopList',
      name: 'medicineShopList',
      component: () =>
        import(
          /* webpackChunkName: "home" */ '@/views/medicineShopList/medicineShopList'
        ),
      meta: {
        index: 2,
      },
    },
    {
      path: '/serve',
      name: 'serve',
      component: () =>
        import(/* webpackChunkName: "serve" */ '@/views/serve/serve'),
      meta: {
        index: 1,
      },
    },
    {
      path: '/map',
      name: 'map',
      component: () => import(/* webpackChunkName: "map" */ '@/views/map/map'),
      meta: {
        index: 1,
      },
    },
    {
      path: '/user',
      name: 'user',
      component: () =>
        import(/* webpackChunkName: "user" */ '@/views/user/user'),
      meta: {
        index: 1,
      },
    },
  ],
})

export default router
